<template>
    <div class="djsearch">
        <div class="itm" v-for="(itm,i) in porsdata" :key="i">
            <div>{{ itm.label }}</div>
            <div v-if="itm.type=='str'">
                <!-- 字符 -->
                <div v-if="itm.search_type!='c'"><vxe-input v-model="itm.def1" :placeholder="itm.label" size="mini"></vxe-input></div>
                <div v-else>
                    <div class="c"><vxe-input v-model="itm.def1" :placeholder="itm.label" size="mini"></vxe-input>至</div>
                    <div class="c"><vxe-input v-model="itm.def2" :placeholder="itm.label" size="mini"></vxe-input></div>
                </div>
            </div>
           
            <div v-else-if="itm.type=='date'">
                <!-- 日期 -->
                <div v-if="itm.search_type!='c'"><vxe-input v-model="itm.def1" :placeholder="itm.label" transfer size="mini" clearable type="date"></vxe-input></div>
                <div v-else>
                    <div class="c"><vxe-input v-model="itm.def1" :placeholder="itm.label" transfer size="mini" clearable type="date"></vxe-input>至</div>
                    <div class="c"><vxe-input v-model="itm.def2" :placeholder="itm.label" transfer size="mini" clearable type="date"></vxe-input></div>
                </div>
            </div>
            <div v-else>
                <!-- 数字 -->
                <div v-if="itm.search_type!='c'"><vxe-input v-model="itm.def1" :placeholder="itm.label" size="mini" type="number"></vxe-input></div>
                <div v-else>
                    <div class="c"><vxe-input v-model="itm.def1" :placeholder="itm.label" size="mini" type="number"></vxe-input>至</div>
                    <div class="c"><vxe-input v-model="itm.def2" :placeholder="itm.label" size="mini" type="number"></vxe-input></div>
                </div>
            </div>
        </div>
    </div>
  </template>
  
  <script>
    export default {
        name: 'componentName',
        components: {},
        props: ['porsdata'],
        data () {
            return {
                data:[]
            }
        },
        activated() {
           
        },
        mounted() {
            console.log('子组件');
            console.log(this.porsdata);
        },
        methods: {
            porsdataEv() {
                return this.porsdata
            }
        }}
  </script>
  
  <style lang='less' scoped>
  .djsearch {
    // height: 50rem;
    // overflow: scroll;
    .itm {
        margin-bottom: 0.2rem;
        // border-bottom: 1px solid;
    }
    .c {
        margin-top: 0.2rem;
        
    }
  }
  </style>